package org.oimwrapper.connectors.internal;

import com.thortech.xl.dataaccess.*;
import com.thortech.xl.dataobj.*;
import java.io.*;
import java.math.*;
import java.net.*;
import java.sql.*;
import java.util.*;

/**
 * JDBC statement interface into OIM.
 * 
 * THIS IS AN INTERNAL CLASS AND SHOULD NOT BE USED DIRECTLY.
 */
final class OIMDBStatement implements PreparedStatement {
	
	/**
	 * The calling oimDbConnection.
	 */
	private OIMDBConnection caller;
	
	/**
	 * The OIM database being used.
	 */
	private tcDataProvider database;
	
	/**
	 * The query or template to base this statement around.
	 */
	private String query;
	
	/**
	 * A Map of the parameters and values provided with 
	 */
	private Map parameters;
	
	/**
	 * Default constructor.
	 * 
	 * @param Caller The calling oimDbConnection.
	 * @param Database The OIM database being used.
	 * @param Query The query or template to base this statement around.
	 */
	protected OIMDBStatement(OIMDBConnection Caller, tcDataProvider Database, String Query) {
		caller = Caller;
		database = Database;
		query = Query;
		parameters = new HashMap();
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void addBatch() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Clears out the list of parameters specified.
	 * 
	 * @exception SQLException
	 */
	public void clearParameters() throws SQLException {
		parameters.clear();
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean execute() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Executes a query and returns the results.
	 * 
	 * @return The results from the query.
	 * @exception SQLException
	 */
	public ResultSet executeQuery() throws SQLException {
		try {
			return new OIMDBResults(database.readPreparedStatement(query, new HashMap(parameters)), this);
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * Executes a query that updates data.
	 * 
	 * @return The number of records affected.
	 * @exception SQLException
	 */
	public int executeUpdate() throws SQLException {
		try {
			return database.writePreparedStatement(query, new HashMap(parameters), new int[] { 0 });
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public ResultSetMetaData getMetaData() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public ParameterMetaData getParameterMetaData() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setArray(int Index, Array Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Size The size of the stream to process.
	 * @exception SQLException
	 */
	public void setAsciiStream(int Index, InputStream Value, int Size) throws SQLException {
		try {
			char[] buffer = new char[Size];
			Reader reader = new InputStreamReader(Value);
			reader.read(buffer, 0, Size);
			setString(Index, new String(buffer));
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setBigDecimal(int Index, BigDecimal Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setBinaryStream(int Index, InputStream Value, int Size) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setBlob(int Index, Blob Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setBoolean(int Index, boolean Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Boolean(Value), StatementTypeValue.BOOLEAN));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setByte(int Index, byte Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Byte(Value), StatementTypeValue.BYTE));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setBytes(int Index, byte[] Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, StatementTypeValue.BYTEARRAY));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Size The size of the stream to process.
	 * @exception SQLException
	 */
	public void setCharacterStream(int Index, Reader StreamReader, int Size) throws SQLException {
		try {
			char[] buffer = new char[Size];
			StreamReader.read(buffer, 0, Size);
			setString(Index, new String(buffer));
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setClob(int Index, Clob Value) throws SQLException {
		try {
			int size = (int) Value.length();
			char[] buffer = new char[size];
			Value.getCharacterStream().read(buffer, 0, size);
			setString(Index, new String(buffer));
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setDate(int Index, java.sql.Date Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, StatementTypeValue.DATE));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Cal The calendar to use to specify the timezone.
	 * @exception SQLException
	 */
	public void setDate(int Index, java.sql.Date Value, Calendar Cal) throws SQLException {
		Cal.setTime(Value);
		parameters.put(new Integer(Index), new java.sql.Date(Cal.getTimeInMillis()));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setDouble(int Index, double Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Double(Value), StatementTypeValue.DOUBLE));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setFloat(int Index, float Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Float(Value), StatementTypeValue.FLOAT));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setInt(int Index, int Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Integer(Value), StatementTypeValue.INTEGER));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setLong(int Index, long Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Long(Value), StatementTypeValue.LONG));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Type The SQL type of the field to set to null.
	 * @exception SQLException
	 */
	public void setNull(int Index, int Type) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(null, Type));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Type The SQL type of the field to set to null.
	 * @param TypeName The name of the SQL type for the field.
	 * @exception SQLException
	 */
	public void setNull(int Index, int Type, String TypeName) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(null, Type));
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setObject(int Index, Object Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Type The SQL type of the field to set.
	 * @exception SQLException
	 */
	public void setObject(int Index, Object Value, int Type) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, Type));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Type The SQL type of the field to set.
	 * @param Scale The number of digits to display after the decimal point.
	 * @exception SQLException
	 */
	public void setObject(int Index, Object Value, int Type, int Scale) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, Type));
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setRef(int Index, Ref Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setShort(int Index, short Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(new Short(Value), StatementTypeValue.SHORT));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setString(int Index, String Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, StatementTypeValue.STRING));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setTime(int Index, Time Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, StatementTypeValue.TIME));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Cal The calendar to use to specify the timezone.
	 * @exception SQLException
	 */
	public void setTime(int Index, Time Value, Calendar Cal) throws SQLException {
		Cal.setTime(Value);
		parameters.put(new Integer(Index), new StatementTypeValue(new java.sql.Date(Cal.getTimeInMillis()), StatementTypeValue.DATE));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @exception SQLException
	 */
	public void setTimestamp(int Index, Timestamp Value) throws SQLException {
		parameters.put(new Integer(Index), new StatementTypeValue(Value, StatementTypeValue.TIMESTAMP));
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Cal The calendar to use to specify the timezone.
	 * @exception SQLException
	 */
	public void setTimestamp(int Index, Timestamp Value, Calendar Cal) throws SQLException {
		Cal.setTime(Value);
		parameters.put(new Integer(Index), new StatementTypeValue(new java.sql.Date(Cal.getTimeInMillis()), StatementTypeValue.DATE));
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setURL(int Index, URL Value) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Sets a parameter to the statement.
	 * 
	 * @param Index The index of the parameter to set.
	 * @param Value The value of the parameter to set.
	 * @param Size The size of the stream to process.
	 * @exception SQLException
	 */
	public void setUnicodeStream(int Index, InputStream Value, int Size) throws SQLException {
		try {
			char[] buffer = new char[Size];
			Reader reader = new InputStreamReader(Value);
			reader.read(buffer, 0, Size);
			parameters.put(new Integer(Index), new String(buffer));
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void addBatch(String Name) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Aborts current action.
	 * 
	 * @exception SQLException
	 */
	public void cancel() throws SQLException {
		try {
			database.rollbackTransaction();
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void clearBatch() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void clearWarnings() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Closes the current statement.  This does nothing, as the OIM database connection
	 * can never be fully closed.
	 * 
	 * @exception SQLException
	 */
	public void close() throws SQLException { ; }

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean execute(String Query) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean execute(String Query, int GenerateKeys) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean execute(String Query, int[] ColumnIndexes) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean execute(String Query, String[] ColumnNames) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int[] executeBatch() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Executes a query and returns the results.
	 * 
	 * @return The results from the query.
	 * @exception SQLException
	 */
	public ResultSet executeQuery(String Query) throws SQLException {
		try {
			return new OIMDBResults(database.readStatement(Query), this);
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * Executes a query that updates data.
	 * 
	 * @return The number of records affected.
	 * @exception SQLException
	 */
	public int executeUpdate(String Query) throws SQLException {
		try {
			return database.writeStatement(Query);
		} catch (Exception e) {
			throw new SQLException(e.getMessage());
		}
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int executeUpdate(String Query, int GenerateKeys) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int executeUpdate(String Query, int[] ColumnIndexes) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int executeUpdate(String Query, String[] ColumnNames) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Gets the calling connection.
	 * 
	 * @return The calling connection.
	 * @exception SQLException
	 */
	public Connection getConnection() throws SQLException {
		return caller;
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getFetchDirection() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getFetchSize() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	public ResultSet getGeneratedKeys() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getMaxFieldSize() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getMaxRows() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean getMoreResults() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public boolean getMoreResults(int Size) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getQueryTimeout() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public ResultSet getResultSet() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getResultSetConcurrency() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getResultSetHoldability() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getResultSetType() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public int getUpdateCount() throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * Gets the warnings from the database connection.
	 * 
	 * @return OIM does not generate specific database warnings, so this will always
	 *         be null.
	 * @exception SQLException
	 */
	public SQLWarning getWarnings() throws SQLException {
		return null;
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setCursorName(String Name) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setEscapeProcessing(boolean Flag) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setFetchDirection(int Direction) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setFetchSize(int Size) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setMaxFieldSize(int Size) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setMaxRows(int Max) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

	/**
	 * This method is not supported.
	 * 
	 * @exception SQLException
	 */
	public void setQueryTimeout(int Timeout) throws SQLException {
		throw new UnsupportedOperationException("Not supported.");
	}

    @Override
    public void setRowId(int parameterIndex, RowId x) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNString(int parameterIndex, String value) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNClob(int parameterIndex, NClob value) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setClob(int parameterIndex, Reader reader) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setNClob(int parameterIndex, Reader reader) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean isClosed() throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setPoolable(boolean poolable) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean isPoolable() throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public <T> T unwrap(Class<T> iface) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}